﻿namespace Hippo.Framework.Web
{
    using System.Net;

    public class BrowserEmulator
    {
        public HttpWebResponse Open(string url)
        {
            var request = (HttpWebRequest)WebRequest.Create(url);
            return (HttpWebResponse) request.GetResponse();
        }

        public TPage Open<TPage>(string url)
            where TPage : Page, new()
        {
            var response = Open(url);
            response.Close();

            return new TPage();
        }
    }
}
